import {Component, OnInit,Output,EventEmitter} from '@angular/core';

@Component({
    selector: 'app-login-form',
    templateUrl: 'login-form.component.html',
    styleUrls: ['login-form.component.css']
})
export class LoginFormComponent implements OnInit {

    //@Input() loginInfo: any;
    //给他定义一个 输出事件： doLogin
    @Output() login = new EventEmitter<any>();

    loginInfo = {
        userName: '',
        password: ''
    };

    constructor() {
    }

    ngOnInit() {

    }

    doLogin() {
        console.log('loginInfo===');
        console.dir(this.loginInfo);
        //this.loginInfo.userName = this.loginInfo.nickname;
        this.login.emit(this.loginInfo);
    }

}
